package com.binyouwei.designpatterns.creation_type.prototype;

/**
 * @author 宾有为
 * @date 2024/6/20 20:36
 * @link https://blog.csdn.net/baidu_41616022?type=blog
 * @describe：原型模式 —— 通过复制现有对象来创建新的对象。
 **/
public class PrototypeMain {

    public static void main(String[] args) {
        ShapeCache.loadCache();

        PrototypeShape clonedShape =  ShapeCache.getShapeMap("1");
        clonedShape.draw();

        PrototypeShape clonedShape2 =  ShapeCache.getShapeMap("2");
        clonedShape2.draw();
    }
}
